package com.example.yls.demob;

import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    MyReceiver receiver;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

         receiver = new MyReceiver();
        IntentFilter filter =new IntentFilter();
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
    }
}
/*
https://blog.csdn.net/fengyenom1/article/details/72870586*/
